// ReSharper disable RedundantUsingDirective
// ReSharper disable DoNotCallOverridableMethodsInConstructor
// ReSharper disable InconsistentNaming
// ReSharper disable PartialTypeWithSinglePart
// ReSharper disable PartialMethodWithSinglePart
// ReSharper disable RedundantNameQualifier

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
//using DatabaseGeneratedOption = System.ComponentModel.DataAnnotations.DatabaseGeneratedOption;

namespace wUniApp.MVC.App_Data
{
    // InheritanceProcedures
    internal partial class InheritanceProcedureConfiguration : EntityTypeConfiguration<InheritanceProcedure>
    {
        public InheritanceProcedureConfiguration(string schema = "")
        {
            ToTable("InheritanceProcedures");
            HasKey(x => x.Id);

            Property(x => x.Id).HasColumnName("Id").IsRequired().HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            Property(x => x.Description).HasColumnName("Description").IsRequired().HasMaxLength(1024);
            Property(x => x.CustomerId).HasColumnName("CustomerId").IsRequired();
            Property(x => x.AmountDue).HasColumnName("AmountDue").IsRequired().HasPrecision(19,4);

            // Foreign keys
            HasRequired(a => a.Customer).WithMany(b => b.InheritanceProcedures).HasForeignKey(c => c.CustomerId); // FK_InheritanceProcedures_Customers
            InitializePartial();
        }
        partial void InitializePartial();
    }

}
